home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Zope.exe / DTML-LET.STX < prev    next >
Encoding:
Text File  |  2000-10-12  |  1.3 KB  |  48 lines

  1. let: Defines DTML variables
  2.  
  3.   The 'let' tag defines variables in the DTML namespace.
  4.  
  5.   Syntax
  6.  
  7.     <dtml-let [Name=Variable][Name="Expression"]...>
  8.     </dtml-let>
  9.  
  10.     The 'let' tag is a block tag. Variables are defined by tag
  11.     arguments. Defined variables are pushed onto the DTML namespace
  12.     while the 'let' block is executed.  Variables are defined by
  13.     attributes. The 'let' tag can have one or more attributes with
  14.     arbitrary names. If the attributes are defined with double quotes
  15.     they are considered expressions, otherwise they are looked up by
  16.     name.  Attributes are processed in order, so later attributes can
  17.     reference, and/or overwrite earlier ones.
  18.  
  19.   Examples
  20.  
  21.    Basic usage::
  22.  
  23.     <dtml-let name="'Bob'" ids=objectIds>
  24.       name: <dtml-var name>
  25.       ids: <dtml-var ids>
  26.     </dtml-let>
  27.     
  28.    Using the 'let' tag with the 'in' tag::
  29.  
  30.      <dtml-in expr="(1,2,3,4)">
  31.        <dtml-let num=sequence-item
  32.                  index=sequence-index
  33.                  result="num*index">
  34.          <dtml-var num> * <dtml-var index> = <dtml-var result>
  35.        </dtml-let>
  36.      </dtml-in>
  37.  
  38.    This yields::
  39.  
  40.       1 * 0 = 0
  41.       2 * 1 = 2
  42.       3 * 2 = 6
  43.       4 * 3 = 12
  44.  
  45.   See Also
  46.  
  47.     "with tag":dtml-with.stx
  48.